package com.ymatou.iapi.godproductsearch.service;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*获取商家二级分类Call
*FreeMaker Template自动生成代码
*/
public class getProductSecondCategoryCall extends YmatouBaseCall{
	private static String opurl ="/getProductSecondCategory";
	
	public getProductSecondCategoryCall() {
		super(EnvSetup.getSystemUrl("godproductsearch_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	 public String getSuccess()
		{
		  return getString("success");
		}
		
	 public String getErrorCode()
		{
		  return getString("errorCode");
		}
		
		
		public JSONArray getCategoryDtos() throws JSONException
		{
		  return new JSONObject(getString("data").toString()).getJSONArray("categoryDtos");
		}
}